package com.zhh.dao;

import com.zhh.pojo.TbFacility;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.Modifying;
import org.springframework.data.jpa.repository.Query;
import org.springframework.data.repository.query.Param;

import javax.transaction.Transactional;

public interface FacilityDao extends JpaRepository<TbFacility,Integer> {

    TbFacility findTbFacilityBySuidEquals(@Param("suid") String suid);

    @Transactional
    @Modifying
    @Query("update TbFacility f set f.state = :state where f.id = :id")
    int updateState(@Param("id") int id,@Param("state") int state);


}
